/* Type declarations for linked list */
#ifndef  _list_H
#define _list_H

struct Node;
struct Property;

typedef unsigned char byte;

enum EDemandProperty {EDemand,EProperty}; 

typedef enum EDemandProperty EDP;

typedef struct 
{
char FullName[20];
char Phone[20];
}Contact;

typedef struct 
{
	byte PropertyKind;//House / Appartment....
	byte PropertyType; //sell / rent ..
	int PropertyPrice;
	char PropertyCity[20];
	byte PropertyRooms;
	byte PropertyActive;
	Contact Contacts[2];
    
 }Property;

typedef struct 
{
byte DemandKind; //Appartment, House shop
byte DemandType; //buy, rent
int DemandPrice;
char DemandCity[20];
byte DemandRooms;

}Demand;


typedef union
{
Demand DemandRecord;
Property PropertyRecord;
}DemandProperty;

typedef DemandProperty ElementType;
typedef struct Node *PtrToNode;
typedef PtrToNode List;
typedef PtrToNode Position;

List MakeEmpty(List L);
Position Header(List L);
Position First(List L);
Position Advance(Position P);
Position AdvanceEx(Position P,int jumps);
ElementType Retrieve(Position P); 
ElementType * RetrieveAdr(Position P); 
int IsEmpty(List L);
int IsLast(Position P, List L);
Position Find(ElementType X, List L);
void Delete(ElementType X, List L);
void DeleteInd(int index,List L);
Position FindPrevious(ElementType X, List L);
void Insert(ElementType X, List L, Position P,EDP DP);
void DeleteList(List L);
#endif  /* _List_H */ 
